OTCreateDeferredTask
Creates a deferred task that identifies a function to be executed at the next deferred task time.C INTERFACE
long OTCreateDeferredTask (OTProcessProcPtr proc, void* arg)C++ INTERFACES
None. C++ applications use the C interface to this function.PARAMETERS
proc
- A pointer to the process callback function you want executed at deferred task time.
arg
- A pointer to application-defined data that Open Transport can pass to your callback function. Pass
NULL
if you do not want this data passed. If you are creating more than one of the same kind of task, you can use different values forarg
to distinguish between the tasks.DESCRIPTION
TheOTCreateDeferredTask
function creates a deferred task that you can schedule for execution at the next deferred task time. The task contains a pointer to the process callback function indicated by theproc
parameter. At the next deferred task time, Open Transport calls your process callback function, passing it thearg
parameter and, for the 68000-family ofMacintosh computers only, restoring the A5 global world to what it was when you originally calledOTCreateDeferredTask
.This function returns a reference that you can use to identify a task in other deferred task functions. If the return value is 0, then there is not enough memory to allocate the necessary data.
If you want to call Open Transport from an interrupt, you can use this function (and
OTScheduleDeferredTask
) instead of the standard Deferred Task Manager functionDTInstall
to create a deferred task that you to call permits Open Transport functions. This allows Open Transport to schedule deferred task processing independently of the underlying deferred task mechanism.SEE ALSO
To schedule a task for execution at deferred task time, call theOTScheduleDeferredTask
function (page 7-17).To destroy a task created with the
OTCreateDeferredTask
function, call theOTDestroyDeferredTask
function (page 7-18).